/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package my.own.beans;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import my.own.service.MyWebService;
import my.own.service.MyWebServiceService;

/**
 *
 * @author Maxim A. Kanev <ask.me.makes@gmail.com> [mkanev]
 */
@ManagedBean
public class StatisticsBean implements Serializable {

    private String precision;
    private String input;
    private String mean;
    private String deviation;
    private String interval;

    private MyWebServiceService service;
    private MyWebService port;

    public StatisticsBean() {
        System.out.println("post construct: initialize");
        precision = "0.95";
        input = "";
        service = new MyWebServiceService();
        port = service.getMyWebServicePort();
    }

    public String getPrecision() {
        return precision;
    }

    public void setPrecision(String precision) {
        this.precision = precision;
    }

    public String getDeviation() {
        return deviation;
    }

    public String getInput() {
        return input;
    }

    public void setInput(String input) {
        this.input = input;
        
        mean = port.getMean(input);
        deviation = port.getDeviation(input);
        interval = port.getInterval(precision, input);
    }

    public String getInterval() {
        return interval;
    }

    public String getMean() {
        return mean;
    }
}
